﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ParkingLot.Utility
{
    public class BytesEncodHelp
    {
        public static byte[] GetBytes(string utf8Base64Value)
        {        
            byte[] resultBytes = Convert.FromBase64String(utf8Base64Value);
            return resultBytes;
        }

        public static string GetBase64utf8(byte[] bytes)
        {
            string result = Convert.ToBase64String(bytes);
            result = get_uft8(result);
            return result;
        }

        public static string get_uft8(string unicodeString)
        {
            UTF8Encoding utf8 = new UTF8Encoding();
            Byte[] encodedBytes = utf8.GetBytes(unicodeString);
            String decodedString = utf8.GetString(encodedBytes); return decodedString;
        }
    }


}
